import http from "@/api";
/**
 * @name 患者列表
 */
// 新增患者
export const addxzhzApi = params => {
  return http.post(`/system/patient`, params, { loading: false });
};

//查询患者列表
export const getListApi = params => {
  return http.get(`/system/patient/listInfo`, params, { loading: false });
};
//删除字典类型
export const deletehzApi = params => {
  return http.delete(`/system/patient/${params.e}`, params, { loading: false });
};
// 导出
export const exporthzInfo = params => {
  return http.download(
    `/system/patient/export?name=${params.name}&hospitalizationNumber=${params.hospitalizationNumber}&phoneNumber=${params.phoneNumber}&idCard=${params.idCard}&pageNum=${params.pageNum}&pageSize=${params.pageSize}`,
    params
  );
};
//新增基本信息
export const AddbaseApi = params => {
  return http.put(`/system/patient/info`, params, { loading: false });
};
//获取患者基本信息

export const getBaseInfoApi = params => {
  return http.get(`/system/patient/getInfo`, params, { loading: false });
};
/**
 * @name 检查信息
 */
//查询检查列表
export const getjxxxListApi = params => {
  return http.get(`/system/examinationRecord/getList`, params, { loading: false });
};
//新增检查信息

export const addjxxxApi = params => {
  return http.post(`/system/examinationRecord`, params, { loading: false });
};
export const xgjxxxApi = params => {
  return http.put(`/system/examinationRecord`, params, { loading: false });
};

// export const addjxxxApi = e => {
//   let adddata = e.adddata;
//   let params = e.file;
//   return http.post(
//     `/system/examinationRecord?patientName=${adddata.patientName}&patientId=${adddata.patientId}&examinationPart=${adddata.examinationPart}&examinationOther=${adddata.examinationOther}&inspectSituation=${adddata.inspectSituation}&remark=${adddata.remark}`,
//     params,
//     { loading: false }
//   );
// };
/**
 * @name  检验记录
 */
//查询检验列表
export const gethyListApi = params => {
  return http.get(`/system/testItem/list`, params, { loading: false });
};
//查询详情
export const jcxxinfoApi = params => {
  return http.get(`/system/examinationRecord/getInfo`, params, { loading: false });
};
//删除
export const deletejclbApi = params => {
  return http.delete(`/system/examinationRecord/${params.id}`, params, { loading: false });
};

/**
 * 化验记录
 */
//查询化验列表
export const pLhyaddApi = params => {
  return http.get(`/system/patientLabHistory/getInfoByPid`, params, { loading: false });
};
//上传文件
export const uploadAPI = params => {
  return http.post(`/common/upload`, params, { loading: false });
};
//化验——根据化验项ID获取化验项目详细
export const getListBylabTestItemId = params => {
  return http.get(`/system/patientLabHistory/getInfo`, params, { loading: false });
};
//删除
export const dehyjlApi = params => {
  return http.delete(`/system/patientLabHistory/${params.id}`, params, { loading: false });
};
//修改化验记录
export const updatehyjlApi = params => {
  return http.put(`/system/patientLabHistory`, params, { loading: false });
};
//添加化验记录
export const addhydApi = params => {
  return http.post(`/system/patientLabHistory`, params, { loading: false });
};
/**
 * 随访模块
 */
export const getsflistApi = params => {
  return http.get(`/system/followUp/list`, params, { loading: false });
};
export const getsflisttwoApi = params => {
  return http.get(`/system/followUp/getInfoByPid`, params, { loading: false });
};
export const addsfAPI = params => {
  return http.post(`/system/followUp`, params, { loading: false });
};

export const addsftwoAPI = params => {
  return http.post(`/system/followUp/addCustom`, params, { loading: false });
};

export const updatesfAPI = params => {
  return http.put(`/system/followUp`, params, { loading: false });
};
export const deltesfApi = params => {
  return http.delete(`/system/followUp/${params.id}`, params, { loading: false });
};
export const sfgetInfoApi = params => {
  return http.get(`/system/followUp/getInfo`, params, { loading: false });
};

/**
 * 处方信息
 */

//添加药方
export const getListcfxxApi = params => {
  return http.get(`/system/prescription/list`, params, { loading: false });
};

export const addcfxxAPI = params => {
  return http.post(`/system/prescription`, params, { loading: false });
};

export const updatecfxxAPI = params => {
  return http.put(`/system/prescription`, params, { loading: false });
};
export const deltecfxxApi = params => {
  return http.delete(`/system/prescription/${params.id}`, params, { loading: false });
};
export const getInfocfxxApi = params => {
  return http.get(`/system/prescription/getInfo`, params, { loading: false });
};
export const getInfoxg = params => {
  return http.get(`/system/patient/getInfo`, params, { loading: false });
};
export const joinxghz = params => {
  return http.put(`/system/patient/join`, params, { loading: false });
};

export const tag_now = params => {
  return http.get(`/system/prescription/tag_now`, params, { loading: false });
};
export const tag_history = params => {
  return http.get(`/system/prescription/tag_history`, params, { loading: false });
};
export const patientEnrollment = params => {
  return http.post(`/system/patient/patientEnrollment`, params, { loading: false });
};
export const editSerialNumber = params => {
  return http.post(`/system/patient/editSerialNumber`, params, { loading: false });
};

export const questionnaire = params => {
  return http.post(`/system/questionnaire`, params, { loading: false });
};
export const getInfowj = params => {
  return http.get(`/system/questionnaire/getInfoByPid`, params, { loading: false });
};

export const ejgetInfo = params => {
  return http.get(`/system/questionnaire/getInfo`, params, { loading: false });
};
export const questionnairexg = params => {
  return http.put(`/system/questionnaire`, params, { loading: false });
};
export const questionnairedel = params => {
  return http.delete(`/system/questionnaire/${params.id}`, params, { loading: false });
};
